
<%@ page language="java"  import="java.util.*" pageEncoding="utf-8"%>

<%@ page import="com.tozhan.cn.Counter" %>
<%
    Counter CountFileHandler=new Counter();
    int count=0;
    if(application.getAttribute("count")==null){
    count=CountFileHandler.readFile(request.getRealPath("/")+"count.txt");
    application.setAttribute("count",new Integer(count));
  }
  count=(Integer)application.getAttribute("count");
  if(session.isNew()) ++count;
  application.setAttribute("count",count);
  CountFileHandler.writeFile(request.getRealPath("/")+"count.txt",
count);
%>
 
    <p> 你是第 <%=count %> 位访客</p>